import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import UserList from "@/views/user/UserList";
import Register from "@/views/user/Register";
import PostSender from "@/views/post/PostSender";
import Login from "@/views/user/Login";
import PostList from "@/views/PostList";
import PostDetail from "@/views/post/PostDetail";
import UserEdit from "@/views/user/UserEdit";
import UserSpace from "@/views/user/UserSpace";

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView
    },    {
        path: '/home',
        name: 'home',
        component: HomeView
    }, {
        path: '/userList',
        name: 'userList',
        component: UserList
    }, {
        path: '/userEdit',
        name: 'userEdit',
        component: UserEdit
    },, {
        path: '/userSpace',
        name: 'userSpace',
        component: UserSpace
    }, {
        path: '/register',
        name: 'register',
        component: Register
    }, {
        path: '/login',
        name: 'login',
        component: Login
    }, {
        path: '/postSender',
        name: 'PostSender',
        component: PostSender
    }, {
        path: '/PostList',
        name: 'PostList',
        component: PostList
    },{
        path: '/postDetail',
        name: 'PostDetail',
        component: PostDetail
    },
    {
        path: '/about',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
